import request from '#/utils/requestAbort';
import { OPTION_KEY, SELECT_DATA } from './helper';
//活聚合接口
export async function queryReanalyzeDataData({ order, param }) {
  const data = {
    flexAggrBody: {
      order: order.map((t) => OPTION_KEY[t]),
      orderSize: SELECT_DATA.length,
      needTotal: true,
      timeOrder: param.pointNum,
      headType: 1,
    },
    spotResumptionInProvinceBody: param,
  };

  return request('/reanalyze/spotResumeAnalysisData/v2/spotResumptionInProvince', {
    method: 'post',
    data,
  });
}

export async function getDynamicColumns(params) {
  return request('/reanalyze/generalDynamicColumns/getDynamicColumns', {
    method: 'POST',
    data: params,
  });
}

export async function saveDynamicColumns(params) {
  return request('/reanalyze/generalDynamicColumns/saveDynamicColumns', {
    method: 'POST',
    data: params,
  });
}
